package com.bdqn.mzc.controller;

import com.bdqn.mzc.model.Result;
import com.bdqn.mzc.model.Scenicspot;
import com.bdqn.mzc.model.Valuate;
import com.bdqn.mzc.service.ShowInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/detail")
public class TripDetailShowController {

    @Autowired
    private ShowInfoService showInfoService;

    @ApiOperation("景区详细信息  " +
            "根据id查询 trip页面 点击哪个动态查询该景区详细信息")
    @GetMapping("/datailed")
    public Result<Scenicspot> scenicDetailed(Integer id){
          return Result.wrapSuccessfulResult(showInfoService.selectScenicspotById(id));
    }

    @ApiOperation("景区评论信息  " +
            "根据已选择的景区  读取对应的评论信息")
    @GetMapping("/comment")
    public Result<List<Valuate>> comment(Integer scenicspotId){
        return Result.wrapSuccessfulResult(showInfoService.selectValuateByScenicspotId(scenicspotId));
    }

}
